package hu.vpszd.services.impl

import hu.vpszd.entities.transaction.LoanApplication
import hu.vpszd.services.LoanApplicationService

import org.hibernate.Criteria
import org.hibernate.criterion.Restrictions
import org.springframework.stereotype.Repository
import org.springframework.transaction.annotation.Transactional

@Repository("loanApplicationService")
@Transactional
class LoanApplicationServiceImpl extends BaseServiceImpl<LoanApplication> implements LoanApplicationService{

	public List<LoanApplication> findAll() {
		return findAll(LoanApplication.class);
	}

	public List<LoanApplication> findByStatus(int status) {
		Criteria criteria = currentSession().createCriteria(LoanApplication.class)
		criteria.add(Restrictions.eq("status", status))
		return criteria.list()
	}
}
